import request from "@/utils/request";

export function getAttendanceList(queryForm) {
  return request({
    url: '/clocking/list', method: 'get', params: queryForm
  })
}

//请假
export function leave(dataForm) {
  return request({
    url: '/clocking/insert', method: 'post', data: dataForm
  })
}

// 获取某条请假记录
export function getAttendanceById(id) {
  return request({
    url: '/clocking/oneClocking', method: 'get', params: {"clockingId": parseInt(id)}
  })
}

//修改某一条的请假信息
export function updateAttendance(queryForm) {
  return request({
    url: '/clocking/update', method: 'put', params: {"clockingId": queryForm.id, "type": parseInt(queryForm.type)}
  })
}

//删除考勤记录
export function deleteAttendance(id) {
  return request({
    url: '/clocking/delete', method: 'delete', params: {"clockingId": parseInt(id)}
  })
}
